const nodata = require('../tw-lib-base/no-data/props')
const padding = require('../tw-lib-base/padding/props')
const border = require('../tw-lib-base/border/props')
module.exports = {
  lists: {
    type: Array,
    default () {
      return [
        {
          id: 1,
          title: '这是新闻标题这是新闻标题这是新闻标题这是新闻标题这是新闻标题',
          classfiy: '校园动态',
          href: '/detail.html',
          target: '_blank',
          date: '2020-10-20'
        },
        {
          id: 2,
          title: '这是新闻标题',
          classfiy: '校园动态',
          href: '/detail.html',
          target: '_blank',
          date: '2020-10-20',
          cover: '/2020/11/17/0b312406-383a-46cc-9c5a-227a7da87ba5/logo.png'
        },
        {
          id: 3,
          title: '这是新闻标题2',
          classfiy: '校园动态',
          href: '/detail.html',
          target: '_blank',
          date: '2020-10-20'
        }
      ]
    },
    name: '列表内容',
    filedType: 'api'
  },

  sortPriority: {
    type: Boolean,
    default: false,
    name: '开启优先级排序',
    nameTip: '优先级排序，规则为优先级越高，越靠前',
    filedType: 'switch'
  },

  hasHref: {
    type: Boolean,
    default: true,
    name: '是否链接跳转',
    filedType: 'switch'
  },

  hasBeforeDot: {
    type: Boolean,
    default: true,
    name: '列表标题序列',
    filedType: 'switch'
  },

  dotType: {
    type: String,
    default: 'circle',
    name: '标题序列样式',
    filedType: 'select',
    options: [
      {
        name: '圆点',
        value: 'circle'
      },
      {
        name: '正方形',
        value: 'square'
      },
      {
        name: '环形',
        value: 'ring'
      },
      {
        name: '图标',
        value: 'img'
      }
    ],
    vif: {
      key: 'hasBeforeDot',
      value: true
    }
  },

  dotimg: {
    type: Array,
    default () {
      return []
    },
    name: '标题序列图片',
    filedType: 'file',
    limit: 1,
    maxSize: 1024,
    vif: {
      key: 'dotType',
      value: 'img'
    }
  },

  dotColor: {
    type: String,
    default: '#999',
    name: '标题序列颜色',
    filedType: 'color',
    vif: {
      key: 'hasBeforeDot',
      value: true
    }
  },

  dotHoverColor: {
    type: String,
    default: '#f12e22',
    name: '标题序列划过颜色',
    filedType: 'color',
    vif: {
      key: 'hasBeforeDot',
      value: true
    }
  },

  dotSize: {
    type: String,
    default: '5px',
    name: '标题序列大小',
    filedType: 'string',
    vif: {
      key: 'hasBeforeDot',
      value: true
    }
  },

  titleColor: {
    type: String,
    default: '#333',
    name: '标题颜色',
    filedType: 'color'
  },

  titleHoverColor: {
    type: String,
    default: '#f12e22',
    name: '标题划过颜色',
    filedType: 'color'
  },

  titleFontSize: {
    type: String,
    default: '16px',
    name: '标题字体大小',
    filedType: 'string'
  },

  isTitleBold: {
    type: Boolean,
    default: false,
    name: '标题加粗',
    filedType: 'switch'
  },

  titleLineHeight: {
    type: String,
    default: '26px',
    name: '标题行高',
    filedType: 'string'
  },

  titleMarginLeft: {
    type: String,
    default: '10px',
    name: '标题外边距（左）',
    filedType: 'string'
  },

  titleMarginRight: {
    type: String,
    default: '20px',
    name: '标题外边距（右）',
    filedType: 'string'
  },

  hasDate: {
    type: Boolean,
    default: true,
    name: '日期',
    filedType: 'switch'
  },

  dateColor: {
    type: String,
    default: '#999',
    name: '日期颜色',
    filedType: 'color',
    vif: {
      key: 'hasDate',
      value: true
    }
  },

  dateFontSize: {
    type: String,
    default: '12px',
    name: '日期字体大小',
    filedType: 'string',
    vif: {
      key: 'hasDate',
      value: true
    }
  },
  hasClassfiy: {
    type: Boolean,
    default: true,
    name: '模块分类',
    filedType: 'switch'
  },

  classfiyColor: {
    type: String,
    default: '#333',
    name: '模块分类颜色',
    filedType: 'color',
    vif: {
      key: 'hasClassfiy',
      value: true
    }
  },

  classfiyHoverColor: {
    type: String,
    default: '#f12e22',
    name: '模块分类划过颜色',
    filedType: 'color',
    vif: {
      key: 'hasClassfiy',
      value: true
    }
  },

  classfiyFontSize: {
    type: String,
    default: '12px',
    name: '模块分类字体大小',
    filedType: 'string',
    vif: {
      key: 'hasClassfiy',
      value: true
    }
  },
  classfiyMrginRight: {
    type: String,
    default: '20px',
    name: '模块分类外边距（右）',
    filedType: 'string',
    vif: {
      key: 'hasClassfiy',
      value: true
    }
  },

  bgColor: {
    type: String,
    default: '#fff',
    name: '行背景色',
    filedType: 'color'
  },

  itemGap: {
    type: String,
    default: '0',
    name: '行间距',
    filedType: 'string'
  },

  bgHoverColor: {
    type: String,
    default: '#fff',
    name: '行背景划过色',
    filedType: 'color'
  },

  IsParentHoverChange: {
    type: Boolean,
    default: false,
    name: '整行划过变色',
    filedType: 'switch'
  },

  parentHoverColor: {
    type: String,
    default: '#f12e22',
    name: '整行划过颜色',
    filedType: 'color',
    vif: {
      key: 'IsParentHoverChange',
      value: true
    }
  },
  titleEllipsis: {
    type: Boolean,
    default: true,
    name: '标题截断',
    filedType: 'switch'
  },
  titleEllipsisLine: {
    type: String,
    default: '1',
    name: '标题截断行数',
    filedType: 'string',
    vif: {
      key: 'titleEllipsis',
      value: true
    }
  },

  imgDefault: {
    type: Array,
    default () {
      return []
    },
    name: '默认图片',
    nameTip: '新闻列表没有图片的时候的默认图片',
    filedType: 'file',
    limit: 1,
    maxSize: 1024
  },

  firstShowImg: {
    type: Boolean,
    default: false,
    name: '第一个显示图文混合（定制）',
    filedType: 'switch'
  },

  firstTwoShowImg: {
    type: Boolean,
    default: false,
    name: '前两个显示图文混合（定制）',
    filedType: 'switch'
  },

  moduleClassfiyPhotoWall: {
    type: Boolean,
    default: false,
    name: '模块分类墙（定制）',
    filedType: 'switch'
  },

  moduleClassfiyPhotoWallHoverColor: {
    type: String,
    default: '#0084F7',
    name: '模块分类墙（定制）划过颜色',
    filedType: 'color',
    vif: {
      key: 'moduleClassfiyPhotoWall',
      value: true
    }
  },

  moduleClassfiyPhotoWallMore: {
    type: Array,
    default () {
      return []
    },
    name: '模块分类墙（定制）更多图标',
    nameTip: '',
    filedType: 'file',
    limit: 1,
    maxSize: 1024,
    vif: {
      key: 'moduleClassfiyPhotoWall',
      value: true
    }
  },

  moduleClassfiyPhotoWallData: {
    type: Array,
    default () {
      return [
        {
          classfiy: '校园动态',
          cover: '/2020/12/10/d4d7d8c5-742d-4306-8864-b1cfba696b5b/默认图片.png',
          coverTarget: '_blank',
          detailHref: '/detail.html',
          coverHref: '/detail.html',
          target: '_blank',
          news: [{
            title: '这是新闻标题这是新闻标题这是新闻标题这是新闻标题这是新闻标题',
            href: '/detail.html',
            target: '_blank',
            date: '2020-10-20'
          },
          {
            title: '这是新闻标题',
            href: '/detail.html',
            target: '_blank',
            date: '2020-10-20'
          }]
        },
        {
          classfiy: '媒体关注',
          detailHref: '/detail.html',
          target: '_blank',
          coverHref: '/detail.html',
          cover: '/2020/11/17/0b312406-383a-46cc-9c5a-227a7da87ba5/logo.png',
          coverTarget: '_blank',
          news: [{
            title: '这是新闻标题这是新闻标题这是新闻标题这是新闻标题这是新闻标题',
            href: '/detail.html',
            target: '_blank',
            date: '2020-10-20'
          },
          {
            title: '这是新闻标题',
            href: '/detail.html',
            target: '_blank',
            date: '2020-10-20'
          }]
        },
        {
          classfiy: '政务公开',
          cover: '',
          coverHref: '',
          coverTarget: '_blank',
          detailHref: '',
          target: '_blank',
          news: []
        }
      ]
    },
    name: '模块分类墙（定制）列表内容',
    filedType: 'api',
    vif: {
      key: 'moduleClassfiyPhotoWall',
      value: true
    }
  },

  moduleClassfiyOnlyTitle: {
    type: Boolean,
    default: false,
    name: '只显示分类（定制）',
    nameTips: '不显示新闻列表',
    filedType: 'switch',
    vif: {
      key: 'moduleClassfiyPhotoWall',
      value: true
    }
  },

  dataIsFromPortal: {
    type: Boolean,
    default: false,
    name: '是否从门户获取数据',
    nameTips: '如果从门户获取数据，则数据集无效',
    filedType: 'switch'
  },

  moudleId: {
    type: String,
    default: '',
    name: '新闻模块Id',
    nameTip: '新闻模块Id参数',
    filedType: 'sync',
    vif: {
      key: 'dataIsFromPortal',
      value: true
    }
  },
  pageNo: {
    type: Number,
    default: 1,
    name: '当前页',
    filedType: 'sync',
    vif: {
      key: 'dataIsFromPortal',
      value: true
    }
  },

  pageSize: {
    type: Number,
    default: 10,
    name: '每页显示多少行',
    filedType: 'sync',
    vif: {
      key: 'dataIsFromPortal',
      value: true
    }
  },

  detaillUrl: {
    type: String,
    default: './detail.html',
    name: '详情页跳转地址',
    filedType: 'string',
    vif: {
      key: 'dataIsFromPortal',
      value: true
    }
  },

  total: {
    type: Number,
    default: 50,
    name: '内容总数',
    filedType: 'sync',
    vif: {
      key: 'dataIsFromPortal',
      value: true
    }
  },

  useClickData: {
    type: Boolean,
    default: false,
    name: '选中新闻传值',
    filedType: 'switch'
  },

  value: {
    type: [Object, Boolean, String, Number],
    default: '',
    name: '选中新闻',
    filedType: 'value',
    dataSource: {
      from: 'lists',
      type: 'array',
      labelKey: 'label',
      valueKey: 'value'
    }
  },

  useHighClick: {
    type: Boolean,
    default: false,
    name: '高亮选中项',
    filedType: 'switch',
    vif: {
      key: 'useClickData',
      value: true
    }
  },

  ...padding,
  ...border,
  ...nodata
}
